<div class="dlzc_box">
    <if condition="!empty($_user['user_id'])">
        <div class="container dlzc">
            <a class="dl" href="javascript:void(0);" onclick="logout();">
                <span>退出</span>
            </a>
            <a class="zc" href="#">
                <span>欢迎您,{$_user['user_name']}</span>
            </a>
        </div>
        <else />
        <div class="container dlzc">
            <a class="zc" href="{:U('Hacker/zc')}">
                <span>注册</span>
            </a>
            <a class="dl" href="{:U('Hacker/dl')}">
                <span>登录</span>
            </a>
        </div>
    </if>
</div>

<script>

    function logout() {
        $.ajax({
            type: "POST",
            url: "{:U('Hacker/logout')}",
            data: {},
            success: function(result) {
                var result=eval("("+result+")");
                if(result.status){
                    window.location.reload();
                }else{
                    layer.msg(result.message);
                }
            }
        });
    }
</script>